from django.conf.urls.defaults import patterns, include, url
from TestApp.views import *
from ecommerce import settings
import os

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

site_media = os.path.join(settings.CURRENT_DIR, 'site_media')

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'ecommerce.views.home', name='home'),
    # url(r'^ecommerce/', include('ecommerce.foo.urls')),
    
    # Uncomment the admin/doc line below to enable admin documentation:
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # url(r'^admin/', include(admin.site.urls)),
    url(r'^hello/', hello),
    url(r'^now/', timenow),
    url(r'^catalog/', home),
    
)

# the function of serving static files by this method is only used for DEBUG
if settings.DEBUG:
    urlpatterns += patterns('',
            # static file directory
            (r'^site_media/(?P<path>.*)$', 'django.views.static.serve',
             {'document_root': site_media}),
    )